package com.yc.project1.aspects;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.Ordered;

/**
 * @author zwei
 * @create 2024-08-04 16:23
 */
public class TwoAspect implements Ordered {
    @Pointcut("execution(* com.yc.project1.service.*.show*(..))")
    private void a(){}
    @Around("a()")
    public Object around(ProceedingJoinPoint pjp){
        System.out.println("twoAspect进来了");
        Object obj=null;
        try {
            obj=pjp.proceed();
        }catch (Throwable e){
            throw new RuntimeException(e);
        }
        System.out.println("twoAspect出去了");
        return obj;
    }

    @Override
    public int getOrder() {
        return 1;
    }
}
